using System;
using System.Collections.Generic;
using System.Linq;
using System.Data;
using System.Runtime.Serialization;

namespace WSBanking.DTO
{
	/// <summary>
	/// Data transfer object which is associated with SEBanking_Card table in database
	/// </summary>
	[DataContract]
	public class SEBanking_CardDTO
	{
		[DataMember]
		public string Card_ID { get; set; }
		[DataMember]
		public string Card_SecurityCode { get; set; }
		[DataMember]
		public DateTime Card_ExpirationDate { get; set; }
		[DataMember]
		public string Acc_ID { get; set; }
		[DataMember]
		public decimal Card_Banlance { get; set; }

		public static SEBanking_CardDTO Translate(DataRow row)
		{
			var dto = new SEBanking_CardDTO
			{
				Card_ID = row["Card_ID"].ToString(),
				Card_SecurityCode = row["Card_SecurityCode"].ToString(),
				Card_ExpirationDate = DateTime.Parse(row["Card_ExpirationDate"].ToString()),
				Acc_ID = row["Acc_ID"].ToString(),
                Card_Banlance = decimal.Parse(row["Card_Banlance"].ToString()),
			};
			return dto;
		}
	}
}